import 'package:demo/theme/app_colors.dart';
import 'package:flutter/material.dart';

import 'package:get/get.dart';

import '../../../theme/app_text_theme.dart';
import 'hint_controller.dart';

class HintView extends GetView<HintController> {
  const HintView({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    /// 0借款指南  1还款指南  2完善信息   3极速审核  4立即放款
    String type = Get.parameters['type'] ?? '';
    String title = '';
    String src = 'https://rthdb.rentianjf.com/images/ic_hint_1.png';
    double height = Get.width * 2912 / 750;
    switch(type){
      case "0":
        title = '借款指南';
        break;
      case "1":
        title = '还款指南';
        src = 'https://rthdb.rentianjf.com/images/ic_hint_2.png';
        height = Get.width * 3216 / 750;
        break;
      case "2":
        title = '完善信息';
        break;
      case "3":
        title = '极速审核';
        break;
      case "4":
        title = '立即放款';
        break;
    }
    return Scaffold(
      body: Column(
        children: [
          AppBar(
            backgroundColor: const Color(0xff4681f6),
            title: Text(title, style: text_title_white),
            iconTheme: const IconThemeData(color: Color_white),
          ),
          Expanded(
            child: SingleChildScrollView(
              child: Column(
                children: [
                  Image.network(src, width: context.width, height: height),
                  InkWell(
                      onTap: () => controller.apply(),
                      child: Image.asset("assets/images/ic_hint_3.png", width: context.width, height: context.width * 181 / 750)),
                ],
              ),
            ),
          ),
        ],
      ),
    );
  }
}
